import React, { Component } from "react";

export default class login extends Component {
  a = "100";
  miref = React.createRef();
  pwref = React.createRef();
  render() {
    return (
      <div>
        <ul>
          <li>
            用户名:
            <input type="text" ref={this.miref} />
          </li>
          <li>
            密码:
            <input type="password" ref={this.pwref} />
          </li>
        </ul>

        <button
          onClick={() => {
            console.log("输入的值", this.pwref.current.value);
            localStorage.setItem("token", this.miref.current.value);
            localStorage.setItem("password", this.pwref.current.value);
            this.props.history.push(`/center`);
          }}
        >
          {" "}
          登录
        </button>
      </div>
    );
  }
}
